<!--
 @description  页面公共布局模块
 @fileName ModuleItem.vue
 @author maliang
 @created 2021/09/27 11:45:00
-->
<template>
  <div class="wrapper">
    <div class="main-title">
      <div
        v-if="describeInfo"
        style="flex:1;display:flex;align-items: center;"
        @click.stop="
          openInstrusction(
            describeInfo.fileName,
            describeInfo.moudleName
          )
        "
      >
        {{ moduleTitle }}
        <img
          class="icon_inst"
          src="@/assets/image/icon_instructions.png"
        >
      </div>
      <div v-else style="flex:1;display:flex;align-items: center;">
        {{ moduleTitle }}
      </div>
    </div>
    <slot name="other" />
    <slot name="content" />
  </div>
</template>

<script>
export default {
  name: 'ModuleItem',
  props: {
    moduleTitle: {
      type: String,
      default: ''
    },
    // 显示描述信息（describeInfo.fileName：描述信息对应的文件名称；describeInfo.moudleName：描述信息对应的模块名称）
    describeInfo: {
      type: Object,
      default: () => {
        return null
      }
    }
  },
  methods: {
    openIntro(code, type) {
      this.openInstrusction(code, `car_${type}`)
    }
  }
}
</script>
<style lang="less" scoped></style>
